1. Technical Field
The present invention relates generally to improved data processing system and in particular to a method and apparatus for processing graphics data. Still more particularly, the present invention relates to a method and apparatus for correcting pixel coordinates and texture coordinates.
2. Description of Related Art
Data processing systems, such as personal computers and work stations, are commonly utilized to run computer-aided design (CAD) applications, computer-aided manufacturing (CAM) applications, and computer-aided software engineering (CASE) tools. Engineers, scientists, technicians, and others employ these applications daily. These applications involve complex calculations, such as finite element analysis, to model stress in structures. Other applications include chemical or molecular modeling applications. CAD/CAM/CASE applications are normally graphics intensive in terms of the information relayed to the user. Data processing system users may employ other graphics intensive applications, such as desktop publishing applications. Generally, users of these applications require and demand that the data processing systems be able to provide extremely fast graphics information.
The processing of a graphics data stream to provide a graphical display on a video display terminal requires an extremely fast graphics system to provide a display with a rapid response. In these types of graphics systems, primitives are received for processing and display. A primitive is a graphics element that is used as a building block for creating images, such as, for example, a point, a line, a triangle, a polygon, or a quadrilateral. A primitive is defined by a group of one or more vertices. A vertex defines a point, an end point of an edge, or a corner of a polygon where two edges meet. Data also is associated with a vertex in which the data includes information, such as positional coordinates, colors, normals, and texture coordinates. Commands are sent to the graphics system to define how the primitives and other data should be processed for display.
With the large amounts of data and computations involved in processing graphics data, especially with three-dimensional applications, many of these computations have been offloaded from the central processing units to a graphics adapter. These geometry calculations have been accelerated by using a multiprocessor system or a hardwired geometry engine in the graphics adapter. Multiprocessing allows flexibility to implement future processes or algorithms, but is difficult to program and adds to the cost and time needed to develop a graphics adapter. On the other hand, hardwired geometry engines are very straight forward to program. With hardwired geometry engines, it is desirable to optimize the hardware implementing these graphics functions within these engines to minimize the time needed to perform the graphic functions. Some of these functions include, for example, transforming coordinates from one coordinate system to another coordinate system, scaling coordinates, clipping objects, and rotating objects.
Therefore, it would be advantageous to have an improved method and apparatus for implementing graphic functions in a manner that reduces the time needed to perform these functions.
The present invention provides a method and apparatus in a graphics system. The graphics system includes an input, wherein the input receives graphics data, wherein the graphics data includes position coordinates and a depth coordinate for an object. An output is present in which the output transmits processed graphics data. The graphics system also contains a plurality of processing elements, wherein the plurality of processing elements generates the processed graphics data. A first processing element within the plurality of processing elements is connected to the input and a last processing element within the plurality of processing elements is connected to the output. A selected processing element within the plurality of processing element receives the position coordinates and the depth coordinate, inverts the depth coordinate to form an inverted depth coordinate, and multiplies the position coordinates by the inverted depth coordinate.